<script>
import { Space as VSpace } from "ant-design-vue";

// 暂未完全实现
export default {
    name:'ZkSpace',
    components:{
        VSpace
    },
    props:{
        hasDivider:{
           type: Boolean,
           default:() => false
        }
    },
    data() {
        return {
           
        }
    },
    render(){
        const props = this.$props;
        const array = this.$slots.default;
        const slots = [];
        const dividerNode = (<a-divider type="vertical" />);
        if (props.hasDivider) {
            array.forEach(i => {
                slots.push(i);
                slots.push(dividerNode);
            });
            array.pop();
        }else{
            array.forEach(i => {
                slots.push(i);
            });
        }
        return (
            <VSpace size="small">
                {Object.keys(slots).map(name => (slots[name]))}
            </VSpace>
        )
    }
}
</script>